<html>
<head><meta charset="utf-8"><title>-Zmir-opt-level Reform compiler-team#319 · t-compiler/major changes · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/index.html">t-compiler/major changes</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html">-Zmir-opt-level Reform compiler-team#319</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201727958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201727958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201727958">(Jun 23 2020 at 13:50)</a>:</h4>
<p>A new proposal has been announced: <a href="https://github.com/rust-lang/compiler-team/issues/319">#319</a>. It will be brought up at the next meeting.</p>



<a name="201732492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201732492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201732492">(Jun 23 2020 at 14:24)</a>:</h4>
<p>The proposal has a level for less debug+little comp time cost and one for less debug+bigger comp time cost. What if you want to enable optimizations that have a big compile time cost, but you do want full debugability?</p>



<a name="201734921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201734921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201734921">(Jun 23 2020 at 14:42)</a>:</h4>
<p>As an example, what I had in mind were things like this:</p>
<div class="codehilite"><pre><span></span><code><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">add</span><span class="p">(</span><span class="n">x</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="n">y</span>: <span class="kt">usize</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">y</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">add</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>where under heavy optimization, this might become the equivalent of:</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">z</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>But it's not as debuggable because you can't step into the <code>add</code> invocation or put a breakpoint on line 2. You can still have full debug symbols and line information, but it's not the same experience you might hope for without the aggressive optimizations enabled.</p>



<a name="201736788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201736788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201736788">(Jun 23 2020 at 14:56)</a>:</h4>
<p>I'd prefer if <code>-Zunsound-mir-optimizations</code> would be called <code>-Zexperimental-mir-optimizations</code>, or something to that extent, since IMO it is more useful to have it as a sort of staging area for new optimizations, where we might not be sure how well they work in practice, but they don't have any acute known soundness issues.</p>



<a name="201737718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201737718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201737718">(Jun 23 2020 at 15:02)</a>:</h4>
<p>Yeah, I like that a lot better. Great suggestion!</p>



<a name="201738362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738362">(Jun 23 2020 at 15:07)</a>:</h4>
<p>are the two flags important to be able to, say, have an experimental optimization at level 0, rather than have <code>-Zmir-opt-level=experimental</code> ?</p>



<a name="201738751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738751">(Jun 23 2020 at 15:10)</a>:</h4>
<p>I think the stuff we know is broken or whatever should be gated separately from the stuff that works, but might be bad or compile times or whatever.</p>



<a name="201738773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738773">(Jun 23 2020 at 15:10)</a>:</h4>
<p>So I was leaning toward two flags for social/documentation reasons not technical ones.</p>



<a name="201738811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738811">(Jun 23 2020 at 15:11)</a>:</h4>
<p>understood</p>



<a name="201738822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738822">(Jun 23 2020 at 15:11)</a>:</h4>
<p>My impression is that some users out there will just go <code>-O9999</code> if you let them</p>



<a name="201738876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738876">(Jun 23 2020 at 15:11)</a>:</h4>
<p><code>-Zexperimental-mir-optimizations</code> to me is kind of like a feature flag</p>



<a name="201738903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738903">(Jun 23 2020 at 15:12)</a>:</h4>
<p>But there's really no reason ever for end-users to set it</p>



<a name="201738966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738966">(Jun 23 2020 at 15:12)</a>:</h4>
<p>yeah :) quite a number of papers have <code>-O9</code> or more</p>



<a name="201738985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201738985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201738985">(Jun 23 2020 at 15:12)</a>:</h4>
<p><span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>



<a name="201739172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739172">(Jun 23 2020 at 15:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/201732492">said</a>:</p>
<blockquote>
<p>The proposal has a level for less debug+little comp time cost and one for less debug+bigger comp time cost. What if you want to enable optimizations that have a big compile time cost, but you do want full debugability?</p>
</blockquote>
<p>Given that we don't really have an equivalent to GCC's <code>-Og</code> with LLVM, I think it's reasonably to punt on this for MIR optimizations as well, at least for now.</p>



<a name="201739193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739193">(Jun 23 2020 at 15:13)</a>:</h4>
<p>(your earlier example was also very interesting, wrt the planned story around users' ability to develop/debug <code>const fns</code> which I don't see being mentioned often I don't think, or might have missed but that's another topic altogether)</p>



<a name="201739382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739382">(Jun 23 2020 at 15:15)</a>:</h4>
<p>I suppose at some point after this we'd turn on <code>-Zmir-opt-level=2</code> when <code>-Copt-level=2/3</code> is passed, right?</p>



<a name="201739555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739555">(Jun 23 2020 at 15:16)</a>:</h4>
<p>Yeah, that seems reasonable to me but I didn't want to suggest a ton of changes all in the same proposal.</p>



<a name="201739615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739615">(Jun 23 2020 at 15:17)</a>:</h4>
<p>If we decide to go this way, it seems like there's also the potential for having an official stabilization path for new MIR optimizations.</p>



<a name="201739675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739675">(Jun 23 2020 at 15:17)</a>:</h4>
<p>But, again, "Future Work" <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="201739998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201739998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201739998">(Jun 23 2020 at 15:19)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="492">@T-compiler</span>: Proposal <a href="https://github.com/rust-lang/compiler-team/issues/319#issuecomment-648232490">#319</a> has been seconded, and will be approved in 10 days if no objections are raised.</p>



<a name="201751488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201751488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201751488">(Jun 23 2020 at 16:47)</a>:</h4>
<p>Seems like perhaps we <em>should</em> have an opt-level=g option.</p>



<a name="201754643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201754643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201754643">(Jun 23 2020 at 17:13)</a>:</h4>
<p>I support this, expect I dont like "experimental" as a euphemism for "buggy"</p>



<a name="201754690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201754690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201754690">(Jun 23 2020 at 17:13)</a>:</h4>
<p>I think the flag to enable known-incorrect optimizations should contain a trigger word like "broken", "wrong", "incorrect", "unsound" or so</p>



<a name="201754846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201754846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201754846">(Jun 23 2020 at 17:14)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/201736788">said</a>:</p>
<blockquote>
<p>I'd prefer if <code>-Zunsound-mir-optimizations</code> would be called <code>-Zexperimental-mir-optimizations</code>, or something to that extent, since IMO it is more useful to have it as a sort of staging area for new optimizations, where we might not be sure how well they work in practice, but they don't have any acute known soundness issues.</p>
</blockquote>
<p>the thing is, we have some passes with known accute soundness issues</p>



<a name="201754854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201754854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201754854">(Jun 23 2020 at 17:14)</a>:</h4>
<p>what do you suggest we do with those?</p>



<a name="201754950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201754950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201754950">(Jun 23 2020 at 17:15)</a>:</h4>
<p>see e.g. <a href="https://github.com/rust-lang/rust/pull/73262">https://github.com/rust-lang/rust/pull/73262</a></p>



<a name="201755671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201755671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201755671">(Jun 23 2020 at 17:21)</a>:</h4>
<p>I expect that not <em>all</em> optimizations controlled by the flag will have known soundness issues, some optimizations might just be complex and new so we aren't yet confident that they're correct in practice (eg. the destination propagation pass once it's merged). For those it would make little sense to label them all as "unsound" off the bat.</p>
<p>(Perhaps the flag should take a pass name and only enable <em>that</em> pass, to make it easier to test out a specific experimental pass and avoid the known-unsound ones?)</p>



<a name="201758553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201758553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201758553">(Jun 23 2020 at 17:46)</a>:</h4>
<blockquote>
<p>I expect that not all optimizations controlled by the flag will have known soundness issues, some optimizations might just be complex and new so we aren't yet confident that they're correct in practice (eg. the destination propagation pass once it's merged). For those it would make little sense to label them all as "unsound" off the bat.</p>
</blockquote>
<p>that sounds like we have 2 different usecases: a "holding area" for known-unsound optimizations, and a "staging area" for new optimizations</p>



<a name="201758578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201758578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201758578">(Jun 23 2020 at 17:47)</a>:</h4>
<p>they might warrant separate treatment</p>



<a name="201759447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201759447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201759447">(Jun 23 2020 at 17:54)</a>:</h4>
<p>Thanks for the feedback <span class="user-mention" data-user-id="120791">@RalfJ</span>!</p>



<a name="201759507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201759507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201759507">(Jun 23 2020 at 17:55)</a>:</h4>
<p>It feels to me like in practice, those two different flags would be used in very similar ways.</p>



<a name="201759639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201759639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201759639">(Jun 23 2020 at 17:56)</a>:</h4>
<p>I suppose it doesn't cost us very much to have two flags but it does feel a bit redundant.</p>



<a name="201760055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201760055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201760055">(Jun 23 2020 at 17:59)</a>:</h4>
<p>Is your concern that users won't know that this flag could cause misoptimizations/unsound behavior and just turn it on to get more optimization?</p>



<a name="201760240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201760240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201760240">(Jun 23 2020 at 18:00)</a>:</h4>
<p>We could emit a warning if this flag is used that explains it enables <code>"experimental, buggy and potentially unsound optimizations that may break your code"</code> or something to that effect.</p>



<a name="201761790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201761790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201761790">(Jun 23 2020 at 18:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125250">Wesley Wiser</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/201760055">said</a>:</p>
<blockquote>
<p>Is your concern that users won't know that this flag could cause misoptimizations/unsound behavior and just turn it on to get more optimization?</p>
</blockquote>
<p>essentially, yes</p>



<a name="201761821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201761821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201761821">(Jun 23 2020 at 18:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125250">Wesley Wiser</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/201760240">said</a>:</p>
<blockquote>
<p>We could emit a warning if this flag is used that explains it enables <code>"experimental, buggy and potentially unsound optimizations that may break your code"</code> or something to that effect.</p>
</blockquote>
<p>hm. I guess there is precedent for that with the "incomplete features" lint.</p>



<a name="201761890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201761890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201761890">(Jun 23 2020 at 18:14)</a>:</h4>
<p>I personally prefer to be as aggressive as possible about this, with a really scary flag name, but I could see how people disagree with that ;)</p>



<a name="201762222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201762222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201762222">(Jun 23 2020 at 18:17)</a>:</h4>
<p>Maybe the flag should require a pass name to enable? Would make it impossible to enable multiple passes, but normally developers will likely only need to test one pass, unless I'm mistaken.</p>



<a name="201767156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201767156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201767156">(Jun 23 2020 at 18:56)</a>:</h4>
<p>Maybe add a <code>-Zmir-passes</code> option that is like <code>-Cpasses</code> except for MIR optimizations instead of LLVM optimizations?</p>



<a name="201769789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201769789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201769789">(Jun 23 2020 at 19:15)</a>:</h4>
<p>I was thinking of building a "proper" MIR pass manager, but that seems like it'd have much bigger scope than what's proposed here</p>



<a name="201769935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201769935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201769935">(Jun 23 2020 at 19:16)</a>:</h4>
<p>(I'm hoping something like that will fall out of our Sealed Rust work eventually)</p>



<a name="201772411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201772411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201772411">(Jun 23 2020 at 19:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/201762222">said</a>:</p>
<blockquote>
<p>Maybe the flag should require a pass name to enable? </p>
</blockquote>
<p>I thought about that but the primary reason I wanted this flag was so we could keep using the mir-opt tests with our unstable/buggy/unsound/experimental optimizations and those tests already test against the output of specific passes. So it seemed fine to just make a binary on/off flag.</p>



<a name="201859641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201859641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201859641">(Jun 24 2020 at 15:05)</a>:</h4>
<p>maybe "incomplete"  optimizations?</p>



<a name="201869600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/201869600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#201869600">(Jun 24 2020 at 16:18)</a>:</h4>
<p>"dangerous"?</p>



<a name="202255151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202255151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202255151">(Jun 28 2020 at 21:03)</a>:</h4>
<p>I'd rather not have a new flag, but since it'd be unstable, I guess I don’t care strongly either way… as long as its not something we would ever consider stabilising.</p>



<a name="202255159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202255159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202255159">(Jun 28 2020 at 21:03)</a>:</h4>
<p>Also, turns out you cannot post a reploy without subscribing to the stream – interesting!</p>



<a name="202255224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202255224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202255224">(Jun 28 2020 at 21:04)</a>:</h4>
<p>(Ability to turn on and off separate passes have many benefits, and is ultimately most flexible)</p>



<a name="202255241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202255241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202255241">(Jun 28 2020 at 21:05)</a>:</h4>
<p>(but as been mentioned above, it'd also involve most engineering effort, and managing optimisation ordering is a hard problem)</p>



<a name="202264839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202264839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202264839">(Jun 29 2020 at 01:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="123586">nagisa</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319/near/202255151">said</a>:</p>
<blockquote>
<p>I'd rather not have a new flag, but since it'd be unstable, I guess I don’t care strongly either way… as long as its not something we would ever consider stabilising.</p>
</blockquote>
<p>Yes, I completely agree. The flag would explicitly be permanently unstable.</p>



<a name="202909240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202909240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202909240">(Jul 05 2020 at 07:13)</a>:</h4>
<p>even with per-pass control I feel like there should be a speed bump to enabling a pass that is considered broken. but that could be in the pass name (<code>-Zmir-opt-pass=simplify-match-arms_unsound</code> etc)</p>



<a name="202962656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962656">(Jul 06 2020 at 08:03)</a>:</h4>
<p>Omg I almost missed this discussion! I'm glad I'm here.</p>



<a name="202962666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962666">(Jul 06 2020 at 08:03)</a>:</h4>
<p>I have two cents</p>



<a name="202962734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962734">(Jul 06 2020 at 08:04)</a>:</h4>
<p>First: I agree with Ralf in that the "experimental" (read: many of these are still broken) opts should have a speedbump or two in the compiler UI</p>



<a name="202962767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962767">(Jul 06 2020 at 08:05)</a>:</h4>
<p>I would use a harsh-ish word at least in the flag</p>



<a name="202962854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962854">(Jul 06 2020 at 08:06)</a>:</h4>
<p>Also, wait, tangent: thank you <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> for making this proposal. I had this in my mind after the discussion regarding mir opt levels but never took the time to continue with it. Thank you thank you thank you.</p>



<a name="202962905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962905">(Jul 06 2020 at 08:07)</a>:</h4>
<p>Second: Wesley, I might be misreading the proposal, but... are all the current Level 2 optimizations classified as being broken?</p>



<a name="202962929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202962929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202962929">(Jul 06 2020 at 08:07)</a>:</h4>
<p>Because I know for a fact that there's one that isn't broken but that we gated at Level 2!</p>



<a name="202963032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202963032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202963032">(Jul 06 2020 at 08:09)</a>:</h4>
<p>(That small thing that we did together to const-propagate function parameters, do you remember?)</p>



<a name="202963077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202963077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202963077">(Jul 06 2020 at 08:10)</a>:</h4>
<p>(We gated that at level 2 because it gave a performance regression from the codegen units that rustc sends to llvm)</p>



<a name="202999161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/202999161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#202999161">(Jul 06 2020 at 14:48)</a>:</h4>
<p>Yeah, I think the only 1:1 correspondence we have right now is the <code>mir-opt-level=1</code> is our stable, performant optimizations. Part of implementing this MCP will involve figuring out what <code>mir-opt-level</code> our other optimizations should go into and also gating some behind the unstable/experimental/unsound flag.</p>



<a name="203025890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203025890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203025890">(Jul 06 2020 at 18:43)</a>:</h4>
<p>Great to hear you have that in mind <span aria-label="blush" class="emoji emoji-1f60a" role="img" title="blush">:blush:</span></p>



<a name="203026037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203026037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203026037">(Jul 06 2020 at 18:45)</a>:</h4>
<p>Ping me whenever that initiative gets started so that I can help :3</p>



<a name="203270548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203270548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203270548">(Jul 08 2020 at 14:00)</a>:</h4>
<p>This proposal has been accepted: <a href="https://github.com/rust-lang/compiler-team/issues/319">#319</a>.</p>



<a name="203276208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203276208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203276208">(Jul 08 2020 at 14:46)</a>:</h4>
<p>okay so the MCP has been closed, but what does that mean for the still open discussion around what to call the flag(s) to enable unfinishd or known-broken optimizations?</p>



<a name="203280011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203280011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203280011">(Jul 08 2020 at 15:15)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> I was planning to leave that discussion to the PR which adds said flag(s). Does that seem reasonable to you?</p>



<a name="203518241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/233931-t-compiler/major%20changes/topic/-Zmir-opt-level%20Reform%20compiler-team%23319/near/203518241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/233931-t-compiler/major-changes/topic/-Zmir-opt-level.20Reform.20compiler-team.23319.html#203518241">(Jul 10 2020 at 15:08)</a>:</h4>
<p>yeah that seems fair</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>